﻿Imports BUS
Imports DTO
Public Class FormBanSach

    Private Sub btnbansach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbansach.Click
        Groupthutien.Visible = True
        groupchitiethoadon.Visible = False
    End Sub

    Private Sub btnthoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthoat.Click
        Me.Close()
    End Sub

    Private Sub btnthutien_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthutien.Click
        groupchitiethoadon.Visible = True
        Groupthutien.Visible = False
    End Sub
    'Load combobox tác giả
    Private Sub LoadDanhSachSach()
        Dim sachBus As New SachBUS()
        Dim dssach As IList
        dssach = sachBus.LayDanhSach()
        cmbsach.DataSource = dssach
        cmbsach.DisplayMember = "TenSach"
        cmbsach.ValueMember = "MaSach"
    End Sub

    'Load combobox Thể loại
    Private Sub LoadDanhSachTheLoai()
        Dim tlBus As New TheLoaiBUS()
        Dim dstheloai As IList
        dstheloai = tlBus.LayDanhSach()
        cmbtheloai.DataSource = dstheloai
        cmbtheloai.DisplayMember = "TenTheLoai"
        cmbtheloai.ValueMember = "MaTheLoai"
    End Sub

    Private Sub FormBanSach_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        datetimengayban.Value = DateTime.Now

        LoadDanhSachSach()
        LoadDanhSachTheLoai()
    End Sub
End Class